package lego.jbv;

import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.robotics.subsumption.Behavior;
import lejos.util.Delay;

public class Stop implements Behavior{
	private Car car;
	
	public Stop(Car _car)
	{
		car = _car;
	}

	@Override
	public boolean takeControl() {
		return Button.ESCAPE.isDown();
	}

	@Override
	public void action() {
		LCD.clear();
		LCD.drawString("Bye bye...", 4, 3);
		
		car.stop();
		
		Delay.msDelay(1000);
		
		System.exit(0);
	}

	@Override
	public void suppress() {

	}

}
